package com.it.tydic.estate.module.service.impl;

import com.it.tydic.estate.module.mapper.inner.TbDataLogMapper;
import com.it.tydic.estate.module.mapper.inner.TbDictionaryMapper;
import com.it.tydic.estate.module.model.inner.TbDataLog;
import com.it.tydic.estate.module.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import com.it.tydic.estate.module.model.inner.TbDictionary;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@Service
@Transactional
public class DictionaryServiceImpl implements DictionaryService {
    @Autowired
    private TbDictionaryMapper tbDictionaryMapper;

    @Autowired
    private TbDataLogMapper tbDataLogMapper;


    @Override
    public List<TbDictionary> findDicByArray( List<String> arrayCode) {
        Example example = new Example(TbDictionary.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andIn("groupCode", arrayCode);
        return tbDictionaryMapper.selectByExample(example);
    }

    @Override
    public void batchInsertDataLog(List<TbDataLog> list) {
        tbDataLogMapper.batchInsertDataLog(list);
    }


}
